#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <omp.h>

#define ceild(n,d)  ceil(((double)(n))/((double)(d)))
#define max(x,y)    ((x) > (y)? (x) : (y))
#define min(x,y)    ((x) < (y)? (x) : (y))
#define myabs(x,y)  (((x) > (y))? ((x)-(y)) : ((y)-(x)))


#define kernel(A) A[(t+1)%2][x][y][z] = 0.54 * (A[(t)%2][x][y][z]) + \
										0.03 * (A[(t)%2][x][y][z-1] + A[(t)%2][x][y-1][z] + \
												A[(t)%2][x][y+1][z] + A[(t)%2][x][y][z+1] + \
												A[(t)%2][x-1][y][z] + A[(t)%2][x+1][y][z])+ \
										0.01 * (A[(t)%2][x-1][y][z-1] + A[(t)%2][x-1][y-1][z] + \
												A[(t)%2][x-1][y+1][z] + A[(t)%2][x-1][y][z+1] + \
												A[(t)%2][x][y-1][z-1] + A[(t)%2][x][y+1][z-1] + \
												A[(t)%2][x][y-1][z+1] + A[(t)%2][x][y+1][z+1] + \
												A[(t)%2][x+1][y][z-1] + A[(t)%2][x+1][y-1][z] + \
												A[(t)%2][x+1][y+1][z] + A[(t)%2][x+1][y][z+1])+ \
										0.02 * (A[(t)%2][x-1][y-1][z-1] + A[(t)%2][x-1][y+1][z-1] + \
												A[(t)%2][x-1][y-1][z+1] + A[(t)%2][x-1][y+1][z+1] + \
												A[(t)%2][x+1][y-1][z-1] + A[(t)%2][x+1][y+1][z-1] + \
												A[(t)%2][x+1][y-1][z+1] + A[(t)%2][x+1][y+1][z+1]);
#define XSLOPE 1
#define YSLOPE 1
#define ZSLOPE 1
#define XSTART 4
#define YSTART 4
#define ZSTART 4
#define DATA_TYPE double

int test_z_uncut(DATA_TYPE * B, int NX, int NY, int NZ, int T, int Bx, int By, int Bz, int tb);

int test_z_blocking(DATA_TYPE * B, int NX, int NY, int NZ, int T, int Bx, int By, int Bz, int tb);
